package net.ib.mtalk.ui.attachment.geotag;

import net.ib.mtalk.util.HttpUtil;
import android.content.Context;

public class GeotagUtil {

	// Static Maps API // 좌표로 이미지 받아오기!
	public static final String STATIC_MAP_API_V2 = "http://maps.google.com/maps/api/staticmap?center=#LATITUDE,#LONGITUDE"
		+ "&zoom=16&size=80x80&sensor=false&format=png";
	public static final String STATIC_MAP_LATITUDE = "#LATITUDE";
	public static final String STATIC_MAP_LONGITUDE = "#LONGITUDE";
	
	public static String getStaticMap(String latitude, String longitude){
		String staticMapUrl = STATIC_MAP_API_V2;
		staticMapUrl.replaceAll(STATIC_MAP_LATITUDE, latitude);
		staticMapUrl.replaceAll(STATIC_MAP_LONGITUDE, longitude);
		return staticMapUrl;
	}
	
	public static void setStaticMap(Context context, String latitude, String longitude, String filePath){
		String staticMapUrl = STATIC_MAP_API_V2;
		staticMapUrl.replaceAll(STATIC_MAP_LATITUDE, latitude);
		staticMapUrl.replaceAll(STATIC_MAP_LONGITUDE, longitude);
		HttpUtil.HttpDown(context, staticMapUrl, filePath);
	}
}
